package model;

/**
 * Created by PanD
 */

public class VirtualMemory {

    //序号
    private Integer number;
    //页号
    private Integer page;
    //偏移
    private Integer offest;
    //地址
    private Integer address;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        VirtualMemory that = (VirtualMemory) o;

        return page.equals(that.page);
    }

    @Override
    public int hashCode() {
        return page.hashCode();
    }

//constructor ---------------------------------------------------------
    public VirtualMemory() {
    }

    public VirtualMemory(Integer number, Integer address, Integer page, Integer offest) {
        this.number = number;
        this.page = page;
        this.offest = offest;
        this.address = address;
    }

    public VirtualMemory(Integer page, Integer offest) {
        this.page = page;
        this.offest = offest;
    }

//getter & setter ---------------------------------------------------------

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getOffest() {
        return offest;
    }

    public void setOffest(Integer offest) {
        this.offest = offest;
    }

    public Integer getAddress() {
        return address;
    }

    public void setAddress(Integer address) {
        this.address = address;
    }

    public Integer getNumber() {
        return number;
    }
}
